package com.aspire.moss.portal.desktop;


/**
 * 保存一个应用的详细信息
 * 
 * @author Administrator
 * 
 */
public class AppInfo extends ItemInfo implements Cloneable {

    /**
	 * 
	 */
    private static final long serialVersionUID = 1L;

    /**
     * 屏幕Id
     */
    public int page_no;

    public int pos_no;

    /**
     * 是否已安装 , 是否有更新
     * 
     * public boolean isInstall ,isUpdate ,isDock;
     */

    public AppInfo(String app_id, String app_name, String app_icon) {
        super(app_id, app_name, app_icon);
    }
    
    
    public AppInfo(String app_id, String app_name, String app_icon, int page_no, int pos_no) {
        super(app_id, app_name, app_icon);
        this.page_no = page_no;
        this.pos_no = pos_no;
    }



    /**
     * 比较两个对象是否在同一个位置
     * 
     * @param appInfo
     * @return
     */
    public boolean eqPosScreen(AppInfo appInfo) {
        if (this.page_no == appInfo.page_no && this.pos_no == appInfo.pos_no) {
            return true;
        }
        return false;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        final AppInfo appInfo = (AppInfo) super.clone();
        appInfo.app_id = app_id;
        appInfo.app_name = app_name;
        appInfo.app_icon = app_icon;
        appInfo.page_no = page_no;
        appInfo.pos_no = pos_no;
        return appInfo;
    }

    public AppInfo cloneAppInfo() {
        try {
            return (AppInfo) this.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }

}
